package com.shopping.mall.core.module.goodData.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shopping.mall.base.excel.converter.TimestampConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.sql.Timestamp;

/**
 * GoodData实体类
 *
 * @author zzy
 * @date 2021-09-02
 */
@Data
@TableName("good_data")
public class GoodData {

    public interface insert {
    }

    public interface update {
    }

    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId(type = IdType.UUID)
    private String id;

    @ExcelProperty("商品ID")
    @ApiModelProperty(value = "商品ID")
    private String goodId;

    @ExcelProperty("规格ID")
    @ApiModelProperty(value = "规格ID")
    private String specificationId;

    @ExcelProperty("商品名")
    @ApiModelProperty(value = "商品名")
    private String goodName;

    @ExcelProperty("访问量")
    @ApiModelProperty(value = "访问量")
    private int visitNum;

    @ExcelProperty("访问占比")
    @TableField(exist = false)
    @ApiModelProperty(value = "访问占比")
    private double visitRate;

    @ExcelProperty("转化率")
    @ApiModelProperty(value = "转化率")
    private double convertRate;

    @ExcelProperty("已下单商品数量")
    @ApiModelProperty(value = "已下单商品数量")
    private int orderGoodsNum;

    @ExcelProperty("已下单销售额")
    @ApiModelProperty(value = "已下单销售额")
    private double orderSale;

    @ExcelIgnore
    @ApiModelProperty(value = "日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Timestamp date;


}
